class Solution {
public:
    bool isOneBitCharacter(vector<int>& bits) {
        int i = 0, n = bits.size();
        if (n == 1) return true;
        while (i < n) {
            if (bits[i] == 1) i++;
            i++;
            if (i == n - 1) return true;
        }
        return false;
    }
};